nums = [2, 2, 1, 1, 1, 2, 2]

res = nums[0]
max_num = 0
hash_table = {}
for i in nums:
    try:
        hash_table[i] += 1
    except:
        hash_table[i] = 1

for key in hash_table:
    if hash_table[key] > max_num:
        max_num = hash_table[key]
        res = key
print(res)
